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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: A = None
        self.v: C = None
        self.y: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: A = None
        self.v: C = None
        self.y: C = None
        self.u: F = None
        self.txt = txt

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

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

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

m.x = d
m.r = l
m.s = g
m.p = j
d.p = j
d.s = j
d.w = j
d.o = c
d.v = g
g.y = d
l.p = j
l.u = j
l.x = m
l.v = g
l.y = g
c.w = n
c.r = l
c.s = j
c.o = m
j.t = l
n.w = c
n.r = l
n.s = j
n.o = m
assert c.s.t.p.t.txt == "l"