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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: F = None
        self.s: E = None
        self.r: E = None
        self.q: F = None
        self.txt = txt

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

c.v = k
c.u = g
c.y = i
g.w = a
g.q = l
i.x = c
i.v = c
i.y = h
j.p = k
a.o = i
k.o = l
k.v = l
k.q = l
k.s = a
k.r = h
e.w = a
e.q = l
l.o = k
l.v = k
l.q = k
l.s = a
l.r = a
h.o = i
assert l.r.o.y.o.y.o.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: B = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: F = None
        self.s: E = None
        self.r: E = None
        self.q: F = None
        self.txt = txt

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

c.v = k
c.u = g
c.y = i
g.w = a
g.q = l
i.x = c
i.v = c
i.y = h
j.p = k
a.o = i
k.o = l
k.v = l
k.q = l
k.s = a
k.r = h
e.w = a
e.q = l
l.o = k
l.v = k
l.q = k
l.s = a
l.r = a
h.o = i
assert l.r.o.y.o.y.o.v.u.txt == "g"