class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: E = None
        self.u: A = None
        self.p: F = None
        self.y: G = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.z: E = None
        self.v: E = None
        self.txt = txt

g = A("g")
j = B("j")
n = C("n")
f = D("f")
m = E("m")
d = F("d")
e = G("e")
a = B("a")
l = C("l")
c = E("c")

g.t = n
j.x = d
j.p = d
j.v = c
j.u = g
j.y = e
j.z = m
n.p = e
n.t = c
n.w = g
f.s = d
m.x = e
d.w = l
d.z = f
e.w = d
e.u = l
e.z = c
e.v = m
a.x = d
a.p = d
a.v = m
a.z = m
a.u = g
a.y = e
l.p = e
l.t = c
l.w = g
c.x = e
assert a.y.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: E = None
        self.u: A = None
        self.p: F = None
        self.y: G = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.z: E = None
        self.v: E = None
        self.txt = txt

g = A("g")
j = B("j")
n = C("n")
f = D("f")
m = E("m")
d = F("d")
e = G("e")
a = B("a")
l = C("l")
c = E("c")

g.t = n
j.x = d
j.p = d
j.v = c
j.u = g
j.y = e
j.z = m
n.p = e
n.t = c
n.w = g
f.s = d
m.x = e
d.w = l
d.z = f
e.w = d
e.u = l
e.z = c
e.v = m
a.x = d
a.p = d
a.v = m
a.z = m
a.u = g
a.y = e
l.p = e
l.t = c
l.w = g
c.x = e
assert a.y.z.x.txt == "e"