class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

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

k = A("k")
f = B("f")
a = C("a")
m = D("m")
n = E("n")
c = F("c")
g = G("g")
h = C("h")
j = A("j")

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

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

k = A("k")
f = B("f")
a = C("a")
m = D("m")
n = E("n")
c = F("c")
g = G("g")
h = C("h")
j = A("j")

k.s = n
f.q = n
f.u = g
a.o = g
m.u = h
m.q = c
m.o = j
m.p = n
n.p = a
c.s = j
c.w = n
c.r = n
c.x = g
c.t = g
c.p = h
c.q = m
g.z = n
g.y = f
g.t = a
h.o = g
j.s = n
assert c.s.s.p.o.z.p.o.z.txt == "n"