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

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

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

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

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

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

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

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

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

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

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

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

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

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

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