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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: H = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: D = None
        self.p: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.p: E = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: H = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: D = None
        self.p: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.p: E = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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