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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: F = None
        self.y: C = 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.y: E = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.r: A = None
        self.v: D = None
        self.p: C = None
        self.txt = txt

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

i = A("i")
e = B("e")
g = C("g")
j = D("j")
c = E("c")
a = F("a")
b = E("b")
n = D("n")
l = C("l")

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: F = None
        self.y: C = 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.y: E = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.r: A = None
        self.v: D = None
        self.p: C = None
        self.txt = txt

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

i = A("i")
e = B("e")
g = C("g")
j = D("j")
c = E("c")
a = F("a")
b = E("b")
n = D("n")
l = C("l")

i.w = e
e.t = b
e.v = a
e.y = g
g.w = e
j.y = c
j.o = a
c.t = j
c.z = j
c.v = j
c.r = i
c.p = l
a.o = e
b.t = j
b.z = n
b.v = n
b.r = i
b.p = l
n.y = b
n.o = a
l.w = e
assert n.o.o.v.o.y.txt == "g"