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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: B = None
        self.txt = txt

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

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

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

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

k.x = g
k.v = d
h.u = k
h.v = e
h.x = a
a.v = d
a.y = h
c.s = d
c.o = h
c.u = m
g.x = c
g.q = d
g.u = i
i.z = h
m.v = d
m.y = h
d.z = h
e.x = c
e.q = i
e.u = i
assert h.u.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: B = None
        self.txt = txt

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

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

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

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

k.x = g
k.v = d
h.u = k
h.v = e
h.x = a
a.v = d
a.y = h
c.s = d
c.o = h
c.u = m
g.x = c
g.q = d
g.u = i
i.z = h
m.v = d
m.y = h
d.z = h
e.x = c
e.q = i
e.u = i
assert h.u.x.u.txt == "i"