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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

i = A("i")
d = B("d")
g = C("g")
l = D("l")
c = E("c")
j = F("j")
k = F("k")
h = F("h")
f = C("f")
b = C("b")

i.u = c
i.s = h
i.z = h
i.y = d
i.r = b
d.w = l
d.t = l
d.x = c
d.z = c
g.o = i
l.r = c
c.z = k
j.r = g
j.o = l
j.x = k
j.p = h
k.r = f
k.o = l
k.x = h
k.p = j
h.r = g
h.o = l
h.x = j
h.p = k
f.o = i
b.o = i
assert i.y.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: F = None
        self.y: B = None
        self.z: F = None
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

i = A("i")
d = B("d")
g = C("g")
l = D("l")
c = E("c")
j = F("j")
k = F("k")
h = F("h")
f = C("f")
b = C("b")

i.u = c
i.s = h
i.z = h
i.y = d
i.r = b
d.w = l
d.t = l
d.x = c
d.z = c
g.o = i
l.r = c
c.z = k
j.r = g
j.o = l
j.x = k
j.p = h
k.r = f
k.o = l
k.x = h
k.p = j
h.r = g
h.o = l
h.x = j
h.p = k
f.o = i
b.o = i
assert i.y.x.z.txt == "k"