class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: D = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: D = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: D = None
        self.x: E = None
        self.s: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.r: A = None
        self.o: G = None
        self.t: E = None
        self.u: C = None
        self.txt = txt

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

j = A("j")
c = B("c")
d = C("d")
b = D("b")
m = E("m")
e = F("e")
a = G("a")

j.t = a
j.r = b
j.y = b
j.p = m
c.r = j
c.o = b
c.x = d
d.v = j
d.y = b
d.x = m
d.s = e
b.r = d
b.p = d
b.y = e
b.w = e
b.t = j
b.q = m
m.p = j
m.w = b
m.z = d
e.x = d
e.u = d
e.p = c
e.r = j
e.o = a
e.t = m
a.q = j
a.w = c
a.z = c
a.p = c
a.o = d
a.r = e
assert c.x.v.p.p.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: D = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: D = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: D = None
        self.x: E = None
        self.s: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.r: A = None
        self.o: G = None
        self.t: E = None
        self.u: C = None
        self.txt = txt

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

j = A("j")
c = B("c")
d = C("d")
b = D("b")
m = E("m")
e = F("e")
a = G("a")

j.t = a
j.r = b
j.y = b
j.p = m
c.r = j
c.o = b
c.x = d
d.v = j
d.y = b
d.x = m
d.s = e
b.r = d
b.p = d
b.y = e
b.w = e
b.t = j
b.q = m
m.p = j
m.w = b
m.z = d
e.x = d
e.u = d
e.p = c
e.r = j
e.o = a
e.t = m
a.q = j
a.w = c
a.z = c
a.p = c
a.o = d
a.r = e
assert c.x.v.p.p.p.z.txt == "d"