class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: G = None
        self.t: E = None
        self.w: E = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

k = A("k")
g = B("g")
h = C("h")
d = D("d")
f = E("f")
c = F("c")
n = G("n")
i = D("i")

k.q = g
k.u = g
k.r = f
g.w = f
g.v = f
g.o = k
h.t = c
h.u = g
d.x = n
d.u = n
d.t = f
d.w = f
d.o = g
f.o = h
f.u = c
f.r = c
f.y = g
c.p = d
c.s = f
n.u = f
n.z = g
n.o = k
i.x = n
i.u = n
i.t = f
i.w = f
i.o = g
assert c.s.o.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: G = None
        self.t: E = None
        self.w: E = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

k = A("k")
g = B("g")
h = C("h")
d = D("d")
f = E("f")
c = F("c")
n = G("n")
i = D("i")

k.q = g
k.u = g
k.r = f
g.w = f
g.v = f
g.o = k
h.t = c
h.u = g
d.x = n
d.u = n
d.t = f
d.w = f
d.o = g
f.o = h
f.u = c
f.r = c
f.y = g
c.p = d
c.s = f
n.u = f
n.z = g
n.o = k
i.x = n
i.u = n
i.t = f
i.w = f
i.o = g
assert c.s.o.u.o.txt == "k"