class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: H = None
        self.u: F = None
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.u: B = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: A = None
        self.z: C = None
        self.p: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: A = None
        self.x: C = None
        self.s: B = None
        self.r: B = None
        self.v: G = None
        self.t: G = None
        self.z: A = None
        self.txt = txt

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

l.q = i
l.y = c
l.u = h
l.z = k
d.r = g
d.s = g
d.v = g
d.o = h
d.w = h
d.u = b
d.p = b
d.t = k
b.o = l
b.u = l
k.u = h
k.p = l
g.r = h
g.x = h
h.s = l
h.w = g
h.z = g
h.u = d
i.o = g
i.y = l
i.z = b
i.p = d
j.o = c
n.p = g
n.q = l
n.z = l
n.x = b
n.s = d
n.r = d
n.v = i
n.t = i
c.o = j
assert b.o.u.u.w.u.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: H = None
        self.u: F = None
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.u: B = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: A = None
        self.z: C = None
        self.p: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: A = None
        self.x: C = None
        self.s: B = None
        self.r: B = None
        self.v: G = None
        self.t: G = None
        self.z: A = None
        self.txt = txt

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

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