class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.t: D = None
        self.w: C = None
        self.y: E = None
        self.v: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.o: F = None
        self.w: F = None
        self.y: F = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
h = C("h")
b = D("b")
f = E("f")
d = F("d")

i.s = h
i.w = h
i.o = b
i.t = b
i.y = f
i.v = d
n.q = f
h.z = i
h.p = d
b.r = f
b.t = i
b.o = d
b.w = d
b.y = d
f.t = h
f.s = h
f.p = d
f.x = n
f.w = n
f.y = n
d.v = h
assert d.v.z.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.t: D = None
        self.w: C = None
        self.y: E = None
        self.v: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.o: F = None
        self.w: F = None
        self.y: F = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
h = C("h")
b = D("b")
f = E("f")
d = F("d")

i.s = h
i.w = h
i.o = b
i.t = b
i.y = f
i.v = d
n.q = f
h.z = i
h.p = d
b.r = f
b.t = i
b.o = d
b.w = d
b.y = d
f.t = h
f.s = h
f.p = d
f.x = n
f.w = n
f.y = n
d.v = h
assert d.v.z.v.v.txt == "h"