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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: E = None
        self.p: B = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.v: E = None
        self.p: C = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.w: A = None
        self.o: H = None
        self.r: D = None
        self.q: G = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: G = None
        self.o: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

b = A("b")
c = B("c")
h = C("h")
l = D("l")
e = E("e")
k = F("k")
i = G("i")
m = H("m")

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: E = None
        self.p: B = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.v: E = None
        self.p: C = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.w: A = None
        self.o: H = None
        self.r: D = None
        self.q: G = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: G = None
        self.o: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

b = A("b")
c = B("c")
h = C("h")
l = D("l")
e = E("e")
k = F("k")
i = G("i")
m = H("m")

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