class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

l = A("l")
d = B("d")
f = C("f")
j = D("j")
n = E("n")
c = F("c")

l.r = n
d.v = f
f.r = c
f.s = c
f.z = j
f.o = j
f.y = n
f.w = d
j.x = c
n.p = j
n.q = j
n.v = j
n.o = d
c.s = n
assert n.p.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

l = A("l")
d = B("d")
f = C("f")
j = D("j")
n = E("n")
c = F("c")

l.r = n
d.v = f
f.r = c
f.s = c
f.z = j
f.o = j
f.y = n
f.w = d
j.x = c
n.p = j
n.q = j
n.v = j
n.o = d
c.s = n
assert n.p.x.s.txt == "n"