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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.r: D = None
        self.v: F = None
        self.y: A = None
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: B = None
        self.u: A = None
        self.s: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.r: D = None
        self.v: F = None
        self.y: A = None
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: B = None
        self.u: A = None
        self.s: E = None
        self.txt = txt

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

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