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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: A = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: F = None
        self.s: H = None
        self.z: G = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: F = None
        self.o: F = None
        self.z: C = None
        self.q: F = None
        self.x: H = None
        self.p: C = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: H = None
        self.y: A = None
        self.z: B = None
        self.x: H = None
        self.s: A = None
        self.w: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: B = None
        self.v: G = None
        self.t: E = None
        self.u: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: A = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: F = None
        self.s: H = None
        self.z: G = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: F = None
        self.o: F = None
        self.z: C = None
        self.q: F = None
        self.x: H = None
        self.p: C = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: H = None
        self.y: A = None
        self.z: B = None
        self.x: H = None
        self.s: A = None
        self.w: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: B = None
        self.v: G = None
        self.t: E = None
        self.u: B = None
        self.txt = txt

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

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