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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: G = None
        self.r: I = None
        self.u: H = None
        self.q: E = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: D = None
        self.t: I = None
        self.z: C = None
        self.u: F = None
        self.w: H = None
        self.y: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: D = None
        self.t: H = None
        self.txt = txt

l = A("l")
j = B("j")
c = C("c")
k = D("k")
f = E("f")
g = F("g")
m = G("m")
b = H("b")
n = I("n")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: G = None
        self.r: I = None
        self.u: H = None
        self.q: E = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: D = None
        self.t: I = None
        self.z: C = None
        self.u: F = None
        self.w: H = None
        self.y: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: D = None
        self.t: H = None
        self.txt = txt

l = A("l")
j = B("j")
c = C("c")
k = D("k")
f = E("f")
g = F("g")
m = G("m")
b = H("b")
n = I("n")

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