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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: F = None
        self.t: G = None
        self.s: A = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: D = None
        self.y: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: F = None
        self.t: G = None
        self.s: A = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: D = None
        self.y: C = None
        self.q: G = None
        self.txt = txt

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

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

n.q = h
i.o = h
i.t = d
i.x = n
f.p = h
f.r = i
f.w = j
h.y = e
h.w = e
h.t = d
h.s = n
h.z = i
h.r = i
m.t = h
m.y = d
e.s = d
e.q = d
e.o = h
e.y = j
d.z = n
d.v = i
g.p = h
g.r = i
g.w = j
j.p = h
j.r = i
j.w = f
assert i.o.t.z.q.z.o.y.txt == "e"