class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: C = None
        self.p: F = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: A = None
        self.txt = txt

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

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

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

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

d.o = n
d.u = n
d.t = l
d.p = c
g.r = c
g.t = a
l.o = n
l.v = d
n.v = l
n.r = l
n.t = l
n.u = a
n.x = a
a.u = c
a.r = c
a.p = l
a.z = d
c.w = l
assert c.w.v.o.x.p.v.txt == "d"