class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: A = None
        self.y: E = None
        self.p: E = None
        self.w: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.t: C = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: A = None
        self.y: E = None
        self.p: E = None
        self.w: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.t: C = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

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

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