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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: B = None
        self.v: A = None
        self.s: D = None
        self.r: E = None
        self.t: C = None
        self.q: B = None
        self.txt = txt

b = A("b")
g = B("g")
c = C("c")
k = D("k")
h = E("h")
a = F("a")
l = G("l")
e = E("e")
m = A("m")
j = B("j")

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: B = None
        self.v: A = None
        self.s: D = None
        self.r: E = None
        self.t: C = None
        self.q: B = None
        self.txt = txt

b = A("b")
g = B("g")
c = C("c")
k = D("k")
h = E("h")
a = F("a")
l = G("l")
e = E("e")
m = A("m")
j = B("j")

b.q = e
g.r = a
g.t = j
g.w = b
c.r = g
k.p = h
h.o = k
h.p = m
h.w = m
a.y = l
a.v = k
l.y = c
l.t = c
l.u = g
l.q = g
l.v = m
l.s = k
l.r = e
e.o = k
e.p = b
e.w = b
m.q = h
j.r = a
j.t = g
j.w = m
assert e.w.q.o.p.p.q.w.q.o.p.txt == "h"