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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

d.x = j
n.s = a
n.t = g
b.v = a
b.q = g
b.t = k
k.s = g
k.x = g
k.q = j
j.s = i
j.p = b
j.t = n
g.u = k
g.r = j
g.t = j
g.v = b
g.w = b
g.q = n
g.y = d
i.t = n
a.s = g
a.x = g
a.q = j
assert g.y.x.t.txt == "n"