class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.y: D = None
        self.x: C = None
        self.s: E = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: E = None
        self.o: B = None
        self.v: F = None
        self.u: F = None
        self.q: F = None
        self.txt = txt

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

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

d = A("d")
n = B("n")
f = C("f")
a = D("a")
c = E("c")
k = F("k")

d.r = c
d.s = c
d.q = f
d.x = f
d.y = a
d.z = k
n.w = f
n.p = d
n.s = d
f.p = d
f.q = a
f.o = c
a.x = c
a.s = c
a.o = n
a.v = k
a.u = k
a.q = k
c.y = d
k.p = n
k.z = n
k.o = a
assert f.q.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.y: D = None
        self.x: C = None
        self.s: E = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: E = None
        self.o: B = None
        self.v: F = None
        self.u: F = None
        self.q: F = None
        self.txt = txt

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

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

d = A("d")
n = B("n")
f = C("f")
a = D("a")
c = E("c")
k = F("k")

d.r = c
d.s = c
d.q = f
d.x = f
d.y = a
d.z = k
n.w = f
n.p = d
n.s = d
f.p = d
f.q = a
f.o = c
a.x = c
a.s = c
a.o = n
a.v = k
a.u = k
a.q = k
c.y = d
k.p = n
k.z = n
k.o = a
assert f.q.v.o.txt == "a"