class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: F = None
        self.t: H = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: A = None
        self.x: A = None
        self.q: A = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: E = None
        self.o: C = None
        self.v: G = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: A = None
        self.x: A = None
        self.q: A = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: E = None
        self.o: C = None
        self.v: G = None
        self.s: C = None
        self.txt = txt

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

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

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

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