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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

c.t = k
c.q = d
g.s = j
g.p = j
g.t = c
g.x = k
g.z = a
a.u = j
a.t = j
a.p = j
k.v = a
k.z = c
k.o = d
d.y = c
d.w = a
d.v = g
j.q = d
assert k.z.q.y.q.y.txt == "c"