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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.p: C = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: E = None
        self.o: F = None
        self.w: F = None
        self.t: C = None
        self.txt = txt

j = A("j")
f = B("f")
e = C("e")
b = D("b")
i = E("i")
d = F("d")
n = G("n")
m = G("m")
c = E("c")

j.p = c
f.s = m
e.z = c
e.u = b
e.p = b
e.w = m
e.r = j
e.q = d
b.o = j
b.x = f
i.z = c
i.w = c
i.p = e
i.y = e
d.z = j
d.w = e
d.q = f
d.u = i
n.p = m
n.x = c
n.o = d
n.w = d
n.t = e
m.p = n
m.x = i
m.o = d
m.w = d
m.t = e
c.z = i
c.w = i
c.p = e
c.y = e
assert e.q.w.u.o.p.z.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.p: C = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: E = None
        self.o: F = None
        self.w: F = None
        self.t: C = None
        self.txt = txt

j = A("j")
f = B("f")
e = C("e")
b = D("b")
i = E("i")
d = F("d")
n = G("n")
m = G("m")
c = E("c")

j.p = c
f.s = m
e.z = c
e.u = b
e.p = b
e.w = m
e.r = j
e.q = d
b.o = j
b.x = f
i.z = c
i.w = c
i.p = e
i.y = e
d.z = j
d.w = e
d.q = f
d.u = i
n.p = m
n.x = c
n.o = d
n.w = d
n.t = e
m.p = n
m.x = i
m.o = d
m.w = d
m.t = e
c.z = i
c.w = i
c.p = e
c.y = e
assert e.q.w.u.o.p.z.y.u.txt == "b"