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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.u: A = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: F = None
        self.q: D = None
        self.x: A = None
        self.t: A = None
        self.y: B = None
        self.txt = txt

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

c = A("c")
j = B("j")
n = C("n")
a = D("a")
b = E("b")
f = F("f")

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.u: A = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: F = None
        self.q: D = None
        self.x: A = None
        self.t: A = None
        self.y: B = None
        self.txt = txt

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

c = A("c")
j = B("j")
n = C("n")
a = D("a")
b = E("b")
f = F("f")

c.r = n
c.x = a
c.p = a
c.q = f
j.t = n
j.p = n
j.w = a
j.u = c
j.v = b
n.y = b
n.v = a
n.p = f
n.w = c
a.y = f
a.x = b
a.w = c
a.q = n
a.u = n
a.p = n
b.o = j
b.y = j
b.z = f
b.q = a
b.x = c
b.t = c
f.o = c
assert f.o.q.o.x.y.txt == "f"