class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

b.x = n
b.o = m
n.t = c
n.o = c
n.y = b
n.w = d
d.t = m
d.y = b
d.x = n
d.u = c
c.v = b
c.r = g
c.z = d
g.p = n
m.o = n
m.y = n
m.u = n
m.p = b
m.z = g
m.w = d
assert c.v.o.p.txt == "b"