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

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

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

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

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

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

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

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

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

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

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

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

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

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

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