class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: F = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

f = A("f")
j = B("j")
h = C("h")
b = D("b")
k = E("k")
c = F("c")

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

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

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

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

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

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

f = A("f")
j = B("j")
h = C("h")
b = D("b")
k = E("k")
c = F("c")

f.t = k
f.s = c
f.r = c
f.w = h
j.u = c
j.v = c
j.z = k
j.t = h
h.u = c
h.o = b
b.z = h
b.v = j
b.u = f
k.t = h
k.z = c
c.t = f
c.q = b
c.y = k
c.u = h
assert j.t.u.q.v.z.txt == "k"