class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: E = None
        self.u: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.p: F = None
        self.txt = txt

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

h = A("h")
j = B("j")
f = C("f")
i = D("i")
g = E("g")
l = F("l")
k = G("k")
c = H("c")
b = B("b")
a = F("a")

h.r = b
h.p = g
h.u = c
j.r = b
j.w = b
j.u = f
j.q = c
f.o = a
f.t = a
i.w = l
g.r = i
g.t = l
g.p = l
g.s = k
g.u = f
g.x = f
l.u = j
l.x = j
l.z = f
l.t = i
l.o = i
k.r = l
k.v = g
k.p = a
c.u = g
b.r = j
b.w = j
b.u = f
b.q = c
a.u = j
a.x = j
a.z = f
a.t = i
a.o = i
assert b.w.u.o.t.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: E = None
        self.u: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.p: F = None
        self.txt = txt

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

h = A("h")
j = B("j")
f = C("f")
i = D("i")
g = E("g")
l = F("l")
k = G("k")
c = H("c")
b = B("b")
a = F("a")

h.r = b
h.p = g
h.u = c
j.r = b
j.w = b
j.u = f
j.q = c
f.o = a
f.t = a
i.w = l
g.r = i
g.t = l
g.p = l
g.s = k
g.u = f
g.x = f
l.u = j
l.x = j
l.z = f
l.t = i
l.o = i
k.r = l
k.v = g
k.p = a
c.u = g
b.r = j
b.w = j
b.u = f
b.q = c
a.u = j
a.x = j
a.z = f
a.t = i
a.o = i
assert b.w.u.o.t.w.t.txt == "i"