class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: C = None
        self.z: E = None
        self.s: C = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: E = None
        self.w: C = None
        self.txt = txt

e = A("e")
a = B("a")
g = C("g")
k = D("k")
n = E("n")
l = F("l")
d = F("d")
j = B("j")

e.y = a
e.z = k
a.t = g
a.x = g
a.s = g
a.z = n
a.u = e
g.z = k
k.r = d
k.p = e
n.x = d
n.w = d
l.u = a
l.s = n
l.w = g
d.u = j
d.s = n
d.w = g
j.t = g
j.x = g
j.s = g
j.z = n
j.u = e
assert e.y.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: C = None
        self.z: E = None
        self.s: C = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: E = None
        self.w: C = None
        self.txt = txt

e = A("e")
a = B("a")
g = C("g")
k = D("k")
n = E("n")
l = F("l")
d = F("d")
j = B("j")

e.y = a
e.z = k
a.t = g
a.x = g
a.s = g
a.z = n
a.u = e
g.z = k
k.r = d
k.p = e
n.x = d
n.w = d
l.u = a
l.s = n
l.w = g
d.u = j
d.s = n
d.w = g
j.t = g
j.x = g
j.s = g
j.z = n
j.u = e
assert e.y.s.z.txt == "k"