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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.y: E = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.y: E = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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