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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: B = None
        self.s: F = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: G = None
        self.u: D = None
        self.w: H = None
        self.v: B = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: A = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: B = None
        self.s: F = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: G = None
        self.u: D = None
        self.w: H = None
        self.v: B = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: A = None
        self.x: B = None
        self.txt = txt

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

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

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