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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.q: B = None
        self.w: D = None
        self.t: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.s: F = None
        self.t: B = None
        self.txt = txt

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

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

j.w = n
j.r = c
j.p = a
j.v = f
g.o = b
g.p = j
g.q = i
g.t = i
g.w = n
c.v = g
c.t = b
n.v = j
a.o = c
a.u = f
a.s = b
a.t = i
b.y = m
b.s = j
m.y = b
m.s = j
i.o = b
i.p = j
i.q = g
i.t = g
i.w = n
f.v = i
f.t = b
assert n.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: C = None
        self.p: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.q: B = None
        self.w: D = None
        self.t: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.s: F = None
        self.t: B = None
        self.txt = txt

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

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

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