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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: F = None
        self.o: F = None
        self.p: C = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: F = None
        self.o: F = None
        self.p: C = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

a.r = e
a.v = h
c.q = h
c.p = h
c.r = n
c.o = l
c.t = f
g.w = h
g.r = i
j.p = g
j.y = l
j.t = h
f.r = a
l.o = a
l.u = e
l.p = n
l.w = i
i.q = h
i.r = l
i.o = n
i.p = g
i.t = f
h.w = g
h.r = c
n.o = a
n.u = j
n.p = l
n.w = i
e.p = g
e.y = l
e.t = h
assert g.w.r.t.r.v.w.w.txt == "h"