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

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

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

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

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

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

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

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

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

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

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

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

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

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

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