class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: C = None
        self.p: G = None
        self.x: B = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.t: A = None
        self.s: E = None
        self.u: B = None
        self.q: D = None
        self.txt = txt

n = A("n")
d = B("d")
h = C("h")
c = D("c")
j = E("j")
i = F("i")
b = G("b")
l = C("l")
a = C("a")

n.s = h
d.u = j
h.t = j
h.z = j
c.r = j
c.q = j
c.u = d
c.w = n
c.v = l
c.z = h
j.s = c
j.q = a
j.p = b
j.x = d
j.u = n
i.z = b
i.s = d
i.x = j
b.x = n
b.p = n
b.t = n
b.s = j
b.u = d
b.q = c
l.t = j
l.z = j
a.t = j
a.z = j
assert d.u.s.q.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: C = None
        self.p: G = None
        self.x: B = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.t: A = None
        self.s: E = None
        self.u: B = None
        self.q: D = None
        self.txt = txt

n = A("n")
d = B("d")
h = C("h")
c = D("c")
j = E("j")
i = F("i")
b = G("b")
l = C("l")
a = C("a")

n.s = h
d.u = j
h.t = j
h.z = j
c.r = j
c.q = j
c.u = d
c.w = n
c.v = l
c.z = h
j.s = c
j.q = a
j.p = b
j.x = d
j.u = n
i.z = b
i.s = d
i.x = j
b.x = n
b.p = n
b.t = n
b.s = j
b.u = d
b.q = c
l.t = j
l.z = j
a.t = j
a.z = j
assert d.u.s.q.p.q.txt == "c"