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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.p: E = None
        self.s: D = None
        self.txt = txt

m = A("m")
l = B("l")
f = C("f")
g = D("g")
n = E("n")
j = F("j")
d = D("d")
b = B("b")
h = E("h")

m.s = h
m.o = f
m.v = f
m.y = b
m.w = l
m.z = j
l.p = f
l.y = d
l.z = h
l.o = m
f.q = g
f.z = m
f.y = n
g.o = j
g.p = f
n.u = f
n.y = l
n.p = m
n.z = h
j.t = m
j.q = l
j.p = n
j.s = d
d.o = j
d.p = f
b.p = f
b.y = g
b.z = h
b.o = m
h.u = f
h.y = l
h.p = m
h.z = n
assert h.z.z.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: C = None
        self.y: B = None
        self.w: B = None
        self.v: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.p: E = None
        self.s: D = None
        self.txt = txt

m = A("m")
l = B("l")
f = C("f")
g = D("g")
n = E("n")
j = F("j")
d = D("d")
b = B("b")
h = E("h")

m.s = h
m.o = f
m.v = f
m.y = b
m.w = l
m.z = j
l.p = f
l.y = d
l.z = h
l.o = m
f.q = g
f.z = m
f.y = n
g.o = j
g.p = f
n.u = f
n.y = l
n.p = m
n.z = h
j.t = m
j.q = l
j.p = n
j.s = d
d.o = j
d.p = f
b.p = f
b.y = g
b.z = h
b.o = m
h.u = f
h.y = l
h.p = m
h.z = n
assert h.z.z.z.u.txt == "f"