class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.t: E = None
        self.v: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.v: B = None
        self.p: B = None
        self.o: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.v: B = None
        self.p: B = None
        self.o: F = None
        self.x: D = None
        self.txt = txt

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

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

e.p = c
e.q = k
e.t = l
e.v = f
c.y = f
d.r = h
d.p = c
d.s = l
d.x = f
d.v = b
b.y = f
b.z = h
b.w = e
l.q = h
l.r = f
l.o = f
l.v = c
l.p = c
l.x = k
f.s = h
k.y = f
k.z = l
k.w = e
h.q = l
h.r = f
h.o = f
h.v = c
h.p = c
h.x = k
assert f.s.r.s.o.s.p.y.txt == "f"