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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: D = None
        self.w: C = None
        self.v: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.o: C = None
        self.u: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: D = None
        self.w: C = None
        self.v: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.o: C = None
        self.u: B = None
        self.txt = txt

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

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