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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.r: B = None
        self.w: A = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: B = None
        self.x: C = None
        self.s: A = None
        self.w: A = None
        self.txt = txt

l = A("l")
j = B("j")
i = C("i")
c = D("c")
f = E("f")
g = A("g")
h = E("h")
m = D("m")
b = A("b")

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.r: B = None
        self.w: A = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: B = None
        self.x: C = None
        self.s: A = None
        self.w: A = None
        self.txt = txt

l = A("l")
j = B("j")
i = C("i")
c = D("c")
f = E("f")
g = A("g")
h = E("h")
m = D("m")
b = A("b")

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