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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: B = None
        self.p: D = None
        self.w: A = None
        self.o: G = None
        self.s: F = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: G = None
        self.v: D = None
        self.z: A = None
        self.r: G = None
        self.s: D = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: C = None
        self.txt = txt

j = A("j")
c = B("c")
n = C("n")
m = D("m")
g = E("g")
b = F("b")
k = G("k")

j.y = c
j.x = m
c.y = m
c.s = n
c.r = n
c.p = j
c.z = g
n.u = c
m.t = j
m.z = n
m.s = n
m.r = n
m.u = n
m.q = b
g.q = k
g.o = k
g.z = k
g.u = c
g.p = m
g.w = j
g.s = b
b.t = g
b.q = k
b.r = k
b.v = m
b.s = m
b.p = m
b.z = j
k.t = b
k.u = n
assert n.u.z.u.y.q.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: B = None
        self.p: D = None
        self.w: A = None
        self.o: G = None
        self.s: F = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: G = None
        self.v: D = None
        self.z: A = None
        self.r: G = None
        self.s: D = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: C = None
        self.txt = txt

j = A("j")
c = B("c")
n = C("n")
m = D("m")
g = E("g")
b = F("b")
k = G("k")

j.y = c
j.x = m
c.y = m
c.s = n
c.r = n
c.p = j
c.z = g
n.u = c
m.t = j
m.z = n
m.s = n
m.r = n
m.u = n
m.q = b
g.q = k
g.o = k
g.z = k
g.u = c
g.p = m
g.w = j
g.s = b
b.t = g
b.q = k
b.r = k
b.v = m
b.s = m
b.p = m
b.z = j
k.t = b
k.u = n
assert n.u.z.u.y.q.r.t.txt == "b"