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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.y: D = None
        self.txt = txt

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

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