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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: C = None
        self.p: C = None
        self.r: E = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: D = None
        self.u: C = None
        self.y: C = None
        self.w: D = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: C = None
        self.p: C = None
        self.r: E = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: D = None
        self.u: C = None
        self.y: C = None
        self.w: D = None
        self.x: C = None
        self.txt = txt

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

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

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