class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: H = None
        self.p: E = None
        self.v: C = None
        self.w: C = None
        self.o: G = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: B = None
        self.t: C = None
        self.w: A = 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.o: B = None
        self.y: C = None
        self.p: G = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: B = None
        self.t: C = None
        self.w: A = 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.o: B = None
        self.y: C = None
        self.p: G = None
        self.r: G = None
        self.txt = txt

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

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

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

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