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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: F = None
        self.q: A = None
        self.s: B = None
        self.x: B = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: D = None
        self.y: A = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

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

k = A("k")
f = B("f")
l = C("l")
g = D("g")
d = E("d")
c = F("c")

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: F = None
        self.q: A = None
        self.s: B = None
        self.x: B = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: D = None
        self.y: A = None
        self.u: B = None
        self.x: B = None
        self.txt = txt

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

k = A("k")
f = B("f")
l = C("l")
g = D("g")
d = E("d")
c = F("c")

k.y = l
k.t = c
k.p = c
k.r = f
k.v = d
f.w = c
l.u = k
l.q = k
l.w = c
l.s = f
l.x = f
l.v = g
g.p = k
d.s = l
d.t = g
d.y = k
d.u = f
d.x = f
c.w = k
c.y = l
c.u = l
c.s = d
c.v = d
c.o = f
assert l.v.p.p.o.txt == "f"