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

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

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

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

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

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

n = A("n")
e = B("e")
d = C("d")
j = D("j")
c = E("c")
m = F("m")

n.s = d
e.y = n
d.u = e
d.v = m
j.q = d
j.o = d
j.w = d
j.t = d
j.u = n
j.s = e
c.r = d
c.v = d
c.t = n
c.u = m
m.o = j
assert e.y.s.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

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

n = A("n")
e = B("e")
d = C("d")
j = D("j")
c = E("c")
m = F("m")

n.s = d
e.y = n
d.u = e
d.v = m
j.q = d
j.o = d
j.w = d
j.t = d
j.u = n
j.s = e
c.r = d
c.v = d
c.t = n
c.u = m
m.o = j
assert e.y.s.v.o.txt == "j"