class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.p: C = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

f = A("f")
a = B("a")
m = C("m")
h = D("h")
j = E("j")
d = F("d")
n = G("n")
c = H("c")
b = G("b")

f.q = a
f.o = b
f.p = m
f.w = j
a.s = d
m.t = j
m.s = j
m.r = d
m.y = a
m.q = a
m.o = a
m.z = f
h.w = a
j.q = m
j.r = b
j.t = n
j.y = n
j.w = a
d.r = f
d.x = m
d.v = c
n.r = a
n.q = j
c.z = m
c.u = j
b.r = a
b.q = j
assert f.w.r.r.s.v.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.p: C = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

f = A("f")
a = B("a")
m = C("m")
h = D("h")
j = E("j")
d = F("d")
n = G("n")
c = H("c")
b = G("b")

f.q = a
f.o = b
f.p = m
f.w = j
a.s = d
m.t = j
m.s = j
m.r = d
m.y = a
m.q = a
m.o = a
m.z = f
h.w = a
j.q = m
j.r = b
j.t = n
j.y = n
j.w = a
d.r = f
d.x = m
d.v = c
n.r = a
n.q = j
c.z = m
c.u = j
b.r = a
b.q = j
assert f.w.r.r.s.v.z.r.txt == "d"