class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: F = None
        self.t: A = None
        self.s: G = None
        self.x: C = None
        self.r: B = None
        self.v: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: F = None
        self.t: A = None
        self.s: G = None
        self.x: C = None
        self.r: B = None
        self.v: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: E = None
        self.txt = txt

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

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