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

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

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

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

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

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

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

k.o = m
k.p = d
e.u = i
i.x = k
h.w = k
h.o = f
h.z = i
h.q = d
d.s = i
d.z = h
d.o = b
f.x = m
c.u = i
b.x = m
m.s = i
m.z = h
m.o = f
g.x = m
assert h.z.x.o.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

k.o = m
k.p = d
e.u = i
i.x = k
h.w = k
h.o = f
h.z = i
h.q = d
d.s = i
d.z = h
d.o = b
f.x = m
c.u = i
b.x = m
m.s = i
m.z = h
m.o = f
g.x = m
assert h.z.x.o.s.x.txt == "k"