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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: B = None
        self.t: E = None
        self.r: E = None
        self.v: D = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: B = None
        self.t: E = None
        self.r: E = None
        self.v: D = None
        self.p: G = None
        self.txt = txt

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

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

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