class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: D = None
        self.t: F = None
        self.p: G = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: G = None
        self.x: G = None
        self.t: F = None
        self.q: B = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.o: C = None
        self.r: B = None
        self.p: A = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: A = None
        self.w: F = None
        self.txt = txt

c = A("c")
h = B("h")
j = C("j")
l = D("l")
i = E("i")
g = F("g")
d = G("d")
a = G("a")

c.x = a
c.r = l
c.t = g
c.p = d
c.w = j
h.x = d
j.z = c
j.r = c
j.v = d
j.x = a
j.t = g
j.q = h
l.w = c
l.z = j
l.x = i
i.z = h
i.w = h
i.r = h
i.s = h
i.o = j
i.y = j
i.p = c
g.x = i
g.w = c
d.p = j
d.q = c
d.w = g
a.p = j
a.q = c
a.w = g
assert a.p.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: D = None
        self.t: F = None
        self.p: G = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: G = None
        self.x: G = None
        self.t: F = None
        self.q: B = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.o: C = None
        self.r: B = None
        self.p: A = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: A = None
        self.w: F = None
        self.txt = txt

c = A("c")
h = B("h")
j = C("j")
l = D("l")
i = E("i")
g = F("g")
d = G("d")
a = G("a")

c.x = a
c.r = l
c.t = g
c.p = d
c.w = j
h.x = d
j.z = c
j.r = c
j.v = d
j.x = a
j.t = g
j.q = h
l.w = c
l.z = j
l.x = i
i.z = h
i.w = h
i.r = h
i.s = h
i.o = j
i.y = j
i.p = c
g.x = i
g.w = c
d.p = j
d.q = c
d.w = g
a.p = j
a.q = c
a.w = g
assert a.p.x.q.txt == "c"