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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: H = None
        self.r: A = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.s: G = None
        self.y: G = None
        self.z: C = None
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: F = None
        self.t: G = None
        self.txt = txt

l = A("l")
f = B("f")
m = C("m")
b = D("b")
d = E("d")
c = F("c")
i = G("i")
g = H("g")
k = G("k")

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: H = None
        self.r: A = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.s: G = None
        self.y: G = None
        self.z: C = None
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: F = None
        self.t: G = None
        self.txt = txt

l = A("l")
f = B("f")
m = C("m")
b = D("b")
d = E("d")
c = F("c")
i = G("i")
g = H("g")
k = G("k")

l.y = c
l.o = b
l.z = d
f.q = l
m.v = l
m.r = l
m.z = g
m.p = b
b.r = g
b.v = d
d.x = c
d.u = l
c.u = b
c.p = f
c.s = k
c.y = i
c.z = m
c.q = d
i.z = m
i.x = m
i.y = c
i.r = k
g.q = f
g.r = c
g.t = i
k.z = m
k.x = m
k.y = c
k.r = i
assert b.r.t.r.r.y.q.txt == "d"