class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: E = None
        self.p: B = None
        self.x: F = None
        self.u: C = None
        self.q: G = None
        self.r: C = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: H = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.txt = txt

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

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

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

j.o = h
j.u = h
j.r = h
j.y = e
j.v = e
j.p = m
j.x = n
j.q = l
m.o = f
m.u = a
m.w = n
h.u = n
h.v = l
f.w = a
e.r = n
e.q = j
n.z = f
n.r = m
l.w = j
l.q = j
l.z = h
l.s = n
l.p = f
a.x = h
a.q = l
assert n.z.w.x.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: E = None
        self.p: B = None
        self.x: F = None
        self.u: C = None
        self.q: G = None
        self.r: C = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: H = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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