class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.x: F = None
        self.y: E = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: E = None
        self.o: D = None
        self.z: A = None
        self.w: E = None
        self.u: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

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

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

n.r = a
n.q = a
n.x = g
n.y = c
n.w = j
n.t = i
a.r = h
a.t = n
i.s = b
i.v = n
i.w = n
i.x = c
i.r = g
i.y = a
d.x = b
d.o = b
d.t = c
d.w = c
d.z = n
d.u = f
c.u = d
c.y = f
c.z = n
g.v = i
j.s = b
j.v = n
j.w = n
j.x = c
j.r = h
j.y = a
h.v = j
b.x = d
b.o = d
b.t = c
b.w = c
b.z = n
b.u = f
f.x = d
f.t = c
f.w = c
f.o = b
f.u = b
f.z = n
assert i.s.w.u.z.w.y.t.y.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.x: F = None
        self.y: E = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: E = None
        self.o: D = None
        self.z: A = None
        self.w: E = None
        self.u: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

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

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

n.r = a
n.q = a
n.x = g
n.y = c
n.w = j
n.t = i
a.r = h
a.t = n
i.s = b
i.v = n
i.w = n
i.x = c
i.r = g
i.y = a
d.x = b
d.o = b
d.t = c
d.w = c
d.z = n
d.u = f
c.u = d
c.y = f
c.z = n
g.v = i
j.s = b
j.v = n
j.w = n
j.x = c
j.r = h
j.y = a
h.v = j
b.x = d
b.o = d
b.t = c
b.w = c
b.z = n
b.u = f
f.x = d
f.t = c
f.w = c
f.o = b
f.u = b
f.z = n
assert i.s.w.u.z.w.y.t.y.y.w.txt == "c"