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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: D = None
        self.s: B = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: D = None
        self.s: B = None
        self.t: E = None
        self.txt = txt

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

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