class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: A = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.q: C = None
        self.r: C = None
        self.z: B = None
        self.txt = txt

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

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

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

b = A("b")
a = B("a")
i = C("i")
h = D("h")
f = E("f")
m = A("m")
g = B("g")

b.v = h
b.s = m
b.q = i
a.t = h
a.u = i
a.q = i
a.r = i
a.z = g
i.y = f
i.r = f
i.w = h
h.u = g
f.v = m
f.o = i
m.v = h
m.s = b
m.q = i
g.t = h
g.u = i
g.q = i
g.r = i
g.z = a
assert h.u.t.u.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: A = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.q: C = None
        self.r: C = None
        self.z: B = None
        self.txt = txt

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

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

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

b = A("b")
a = B("a")
i = C("i")
h = D("h")
f = E("f")
m = A("m")
g = B("g")

b.v = h
b.s = m
b.q = i
a.t = h
a.u = i
a.q = i
a.r = i
a.z = g
i.y = f
i.r = f
i.w = h
h.u = g
f.v = m
f.o = i
m.v = h
m.s = b
m.q = i
g.t = h
g.u = i
g.q = i
g.r = i
g.z = a
assert h.u.t.u.t.u.txt == "g"