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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: F = None
        self.w: A = None
        self.o: G = None
        self.q: C = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: G = None
        self.x: G = None
        self.w: A = None
        self.p: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: C = None
        self.y: D = None
        self.u: C = None
        self.s: G = None
        self.q: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: F = None
        self.w: A = None
        self.o: G = None
        self.q: C = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: G = None
        self.x: G = None
        self.w: A = None
        self.p: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: C = None
        self.y: D = None
        self.u: C = None
        self.s: G = None
        self.q: C = None
        self.txt = txt

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

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