class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: F = None
        self.q: H = None
        self.s: D = None
        self.v: E = None
        self.r: E = None
        self.z: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: E = None
        self.v: C = None
        self.w: A = None
        self.p: D = None
        self.z: G = None
        self.y: G = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: A = None
        self.p: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: B = None
        self.w: G = None
        self.x: B = None
        self.t: E = None
        self.y: C = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: E = None
        self.v: C = None
        self.w: A = None
        self.p: D = None
        self.z: G = None
        self.y: G = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: A = None
        self.p: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: B = None
        self.w: G = None
        self.x: B = None
        self.t: E = None
        self.y: C = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: E = None
        self.txt = txt

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

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

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