class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: F = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: D = None
        self.s: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

e.o = h
e.y = f
e.t = i
k.w = c
k.y = c
k.s = i
k.v = i
b.u = h
c.u = h
c.q = b
c.w = b
c.p = f
c.v = e
h.s = e
h.v = f
h.o = b
f.r = b
f.x = b
i.w = c
i.y = c
i.s = k
i.v = k
assert b.u.v.r.u.v.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: F = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: D = None
        self.s: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

e.o = h
e.y = f
e.t = i
k.w = c
k.y = c
k.s = i
k.v = i
b.u = h
c.u = h
c.q = b
c.w = b
c.p = f
c.v = e
h.s = e
h.v = f
h.o = b
f.r = b
f.x = b
i.w = c
i.y = c
i.s = k
i.v = k
assert b.u.v.r.u.v.x.u.txt == "h"