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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: F = None
        self.z: A = None
        self.txt = txt

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

e = A("e")
f = B("f")
h = C("h")
m = D("m")
d = E("d")
l = F("l")
i = F("i")
n = D("n")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: F = None
        self.z: A = None
        self.txt = txt

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

e = A("e")
f = B("f")
h = C("h")
m = D("m")
d = E("d")
l = F("l")
i = F("i")
n = D("n")

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