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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: F = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: H = None
        self.p: B = None
        self.u: B = None
        self.txt = txt

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

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

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

l.z = j
l.w = m
a.t = h
e.s = m
m.r = f
m.u = f
m.z = g
m.p = g
j.o = a
j.y = a
j.r = h
h.v = l
h.r = f
h.p = a
h.u = a
g.o = f
f.u = a
f.w = m
f.o = m
f.x = h
f.s = e
f.p = g
assert e.s.p.o.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: F = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: H = None
        self.p: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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