class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: C = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

l = A("l")
n = B("n")
h = C("h")
i = D("i")
b = E("b")
e = A("e")
m = B("m")
k = C("k")
g = C("g")

l.q = i
l.r = g
l.x = e
l.y = e
n.w = b
n.t = m
h.o = k
h.v = b
i.x = b
i.w = b
b.w = n
e.q = i
e.r = g
e.x = l
e.y = l
m.w = b
m.t = n
k.o = g
k.v = b
g.o = k
g.v = b
assert l.q.x.w.w.w.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: C = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

l = A("l")
n = B("n")
h = C("h")
i = D("i")
b = E("b")
e = A("e")
m = B("m")
k = C("k")
g = C("g")

l.q = i
l.r = g
l.x = e
l.y = e
n.w = b
n.t = m
h.o = k
h.v = b
i.x = b
i.w = b
b.w = n
e.q = i
e.r = g
e.x = l
e.y = l
m.w = b
m.t = n
k.o = g
k.v = b
g.o = k
g.v = b
assert l.q.x.w.w.w.t.t.t.txt == "m"