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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: F = None
        self.z: G = None
        self.y: E = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: C = None
        self.x: D = None
        self.txt = txt

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

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

n = A("n")
k = B("k")
f = C("f")
b = D("b")
j = E("j")
d = F("d")
a = G("a")
l = B("l")

n.y = j
n.t = d
k.q = b
f.z = j
f.w = d
f.p = d
b.w = j
b.y = j
b.q = j
b.p = d
b.z = a
j.q = d
j.y = f
j.x = b
d.y = f
d.p = a
a.v = n
a.w = b
l.q = b
assert n.y.q.p.v.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: F = None
        self.z: G = None
        self.y: E = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: C = None
        self.x: D = None
        self.txt = txt

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

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

n = A("n")
k = B("k")
f = C("f")
b = D("b")
j = E("j")
d = F("d")
a = G("a")
l = B("l")

n.y = j
n.t = d
k.q = b
f.z = j
f.w = d
f.p = d
b.w = j
b.y = j
b.q = j
b.p = d
b.z = a
j.q = d
j.y = f
j.x = b
d.y = f
d.p = a
a.v = n
a.w = b
l.q = b
assert n.y.q.p.v.t.p.txt == "a"