class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: B = None
        self.r: G = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: G = None
        self.txt = txt

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

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

k.t = j
k.s = m
k.v = m
k.r = n
m.x = a
m.v = a
c.u = j
c.x = n
c.y = k
f.s = n
a.u = k
a.p = j
j.z = a
j.x = n
n.o = m
n.u = a
n.p = c
i.t = j
i.s = m
i.v = m
i.r = n
assert a.p.z.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: B = None
        self.r: G = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: G = None
        self.txt = txt

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

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

k.t = j
k.s = m
k.v = m
k.r = n
m.x = a
m.v = a
c.u = j
c.x = n
c.y = k
f.s = n
a.u = k
a.p = j
j.z = a
j.x = n
n.o = m
n.u = a
n.p = c
i.t = j
i.s = m
i.v = m
i.r = n
assert a.p.z.u.r.txt == "n"