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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: H = None
        self.r: D = None
        self.t: E = None
        self.y: D = None
        self.txt = txt

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

f = A("f")
i = B("i")
g = C("g")
m = D("m")
b = E("b")
a = F("a")
j = G("j")
d = H("d")
l = G("l")
e = C("e")

f.v = i
i.u = f
i.z = b
i.r = m
i.x = m
g.v = e
g.y = e
g.r = d
g.o = f
m.t = f
m.p = a
m.r = b
b.u = j
b.q = d
a.x = m
a.s = i
a.u = i
j.s = f
j.p = d
j.r = m
j.y = m
j.t = b
d.o = b
d.p = m
l.s = f
l.p = d
l.r = m
l.y = m
l.t = b
e.v = g
e.y = g
e.r = d
e.o = f
assert f.v.z.q.p.r.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: H = None
        self.r: D = None
        self.t: E = None
        self.y: D = None
        self.txt = txt

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

f = A("f")
i = B("i")
g = C("g")
m = D("m")
b = E("b")
a = F("a")
j = G("j")
d = H("d")
l = G("l")
e = C("e")

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