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

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

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

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

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

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

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

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

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

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

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

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

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

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

k.r = i
k.q = f
k.o = j
k.p = j
k.x = g
k.y = a
f.t = k
f.w = k
f.x = a
f.y = g
f.r = g
f.q = c
g.v = a
c.w = j
c.z = k
c.v = g
c.y = g
c.x = i
a.y = g
j.w = f
i.v = a
assert j.w.y.v.txt == "a"