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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: C = None
        self.o: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: C = None
        self.o: C = None
        self.q: G = None
        self.txt = txt

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

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

h.q = a
h.w = a
h.y = a
h.r = e
h.o = m
h.s = m
h.p = f
g.p = m
g.s = n
g.w = c
m.q = n
m.t = f
a.t = c
a.z = c
a.w = g
f.p = h
f.w = l
f.x = e
f.o = a
n.z = g
n.p = m
n.o = m
n.q = c
e.x = f
c.x = l
l.p = h
l.w = f
l.x = e
l.o = a
assert l.p.o.t.o.w.p.t.x.txt == "e"