class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: F = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: D = None
        self.y: B = None
        self.v: E = None
        self.txt = txt

c = A("c")
g = B("g")
b = C("b")
f = D("f")
j = E("j")
k = F("k")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: D = None
        self.y: B = None
        self.v: E = None
        self.txt = txt

c = A("c")
g = B("g")
b = C("b")
f = D("f")
j = E("j")
k = F("k")

c.q = g
c.t = k
c.p = b
g.s = j
g.w = c
g.y = b
b.s = g
b.v = c
f.o = j
f.y = j
f.x = k
f.u = c
j.u = g
j.r = b
k.r = g
k.y = g
k.p = f
k.v = j
assert f.u.p.v.t.txt == "k"