class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: H = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: H = None
        self.s: H = None
        self.z: E = None
        self.v: C = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: B = None
        self.o: E = None
        self.w: E = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: H = None
        self.s: H = None
        self.z: E = None
        self.v: C = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: B = None
        self.o: E = None
        self.w: E = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

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

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

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