class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: F = None
        self.r: I = None
        self.u: C = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: C = None
        self.x: B = None
        self.t: B = None
        self.u: F = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: I = None
        self.o: B = None
        self.y: B = None
        self.u: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

f = A("f")
h = B("h")
i = C("i")
e = D("e")
c = E("c")
j = F("j")
n = G("n")
l = H("l")
m = I("m")

f.q = l
h.t = n
h.s = j
h.r = m
h.u = i
h.z = e
i.p = f
i.v = f
e.s = h
e.x = h
e.t = h
e.w = i
e.y = i
e.u = j
c.r = f
c.s = j
j.z = i
j.q = m
j.o = h
j.y = h
j.u = n
n.s = c
l.u = n
m.v = j
m.z = j
m.o = j
m.t = c
m.p = h
assert f.q.u.s.r.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: F = None
        self.r: I = None
        self.u: C = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: C = None
        self.x: B = None
        self.t: B = None
        self.u: F = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: I = None
        self.o: B = None
        self.y: B = None
        self.u: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

f = A("f")
h = B("h")
i = C("i")
e = D("e")
c = E("c")
j = F("j")
n = G("n")
l = H("l")
m = I("m")

f.q = l
h.t = n
h.s = j
h.r = m
h.u = i
h.z = e
i.p = f
i.v = f
e.s = h
e.x = h
e.t = h
e.w = i
e.y = i
e.u = j
c.r = f
c.s = j
j.z = i
j.q = m
j.o = h
j.y = h
j.u = n
n.s = c
l.u = n
m.v = j
m.z = j
m.o = j
m.t = c
m.p = h
assert f.q.u.s.r.q.u.txt == "n"