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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

f.s = i
f.x = i
f.z = n
f.o = l
f.u = g
f.w = c
g.p = b
g.r = i
g.x = n
k.x = f
k.q = n
n.u = k
l.z = n
l.v = n
b.r = n
j.p = b
j.r = i
j.x = n
i.z = n
i.v = n
c.x = f
c.q = n
assert j.r.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: D = None
        self.o: E = None
        self.u: B = None
        self.x: E = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

f.s = i
f.x = i
f.z = n
f.o = l
f.u = g
f.w = c
g.p = b
g.r = i
g.x = n
k.x = f
k.q = n
n.u = k
l.z = n
l.v = n
b.r = n
j.p = b
j.r = i
j.x = n
i.z = n
i.v = n
c.x = f
c.q = n
assert j.r.v.u.txt == "k"