class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: E = None
        self.z: A = None
        self.p: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

k.v = l
k.o = c
k.z = i
k.p = a
a.o = j
a.y = f
b.t = c
b.x = c
l.v = f
l.w = a
c.w = a
m.p = l
m.y = j
m.t = c
j.p = c
j.s = c
j.o = a
j.q = g
i.v = l
i.o = c
i.z = k
i.p = a
g.p = c
g.s = c
g.o = a
g.q = j
f.p = l
f.y = g
f.t = c
assert g.o.y.t.w.y.t.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: E = None
        self.z: A = None
        self.p: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

k.v = l
k.o = c
k.z = i
k.p = a
a.o = j
a.y = f
b.t = c
b.x = c
l.v = f
l.w = a
c.w = a
m.p = l
m.y = j
m.t = c
j.p = c
j.s = c
j.o = a
j.q = g
i.v = l
i.o = c
i.z = k
i.p = a
g.p = c
g.s = c
g.o = a
g.q = j
f.p = l
f.y = g
f.t = c
assert g.o.y.t.w.y.t.w.o.txt == "j"