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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.txt = txt

c = A("c")
e = B("e")
g = C("g")
a = D("a")
j = E("j")
n = F("n")
d = B("d")
i = A("i")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.txt = txt

c = A("c")
e = B("e")
g = C("g")
a = D("a")
j = E("j")
n = F("n")
d = B("d")
i = A("i")

c.s = i
c.p = i
c.r = n
c.y = a
c.x = g
e.x = n
e.u = n
e.p = j
e.s = j
e.r = i
e.q = d
g.z = e
g.p = j
g.u = i
g.q = n
a.r = n
a.s = i
a.u = g
a.w = d
j.t = d
n.o = g
n.z = g
d.x = n
d.u = n
d.p = j
d.s = j
d.r = c
d.q = e
i.s = c
i.p = c
i.r = n
i.y = a
i.x = g
assert n.z.u.x.z.p.t.s.t.txt == "d"