class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: C = None
        self.u: D = None
        self.p: E = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: D = None
        self.r: A = None
        self.q: A = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: F = None
        self.s: E = None
        self.v: C = None
        self.r: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: D = None
        self.r: A = None
        self.q: A = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: F = None
        self.s: E = None
        self.v: C = None
        self.r: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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