class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: B = None
        self.p: G = None
        self.t: C = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

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

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