class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: E = None
        self.v: C = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

h = A("h")
f = B("f")
d = C("d")
b = D("b")
c = E("c")
j = F("j")
e = B("e")
l = A("l")
m = F("m")
a = E("a")

h.u = l
h.w = l
h.q = c
h.v = d
f.t = h
f.r = h
f.s = c
f.o = a
f.v = m
d.v = f
d.w = b
b.t = c
c.o = l
j.y = a
j.u = b
j.q = m
j.r = d
j.o = e
e.t = h
e.r = l
e.s = a
e.o = a
e.v = m
l.u = h
l.w = h
l.q = c
l.v = d
m.y = c
m.u = b
m.q = j
m.r = d
m.o = f
a.o = h
assert h.u.v.w.t.o.q.o.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: E = None
        self.v: C = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

h = A("h")
f = B("f")
d = C("d")
b = D("b")
c = E("c")
j = F("j")
e = B("e")
l = A("l")
m = F("m")
a = E("a")

h.u = l
h.w = l
h.q = c
h.v = d
f.t = h
f.r = h
f.s = c
f.o = a
f.v = m
d.v = f
d.w = b
b.t = c
c.o = l
j.y = a
j.u = b
j.q = m
j.r = d
j.o = e
e.t = h
e.r = l
e.s = a
e.o = a
e.v = m
l.u = h
l.w = h
l.q = c
l.v = d
m.y = c
m.u = b
m.q = j
m.r = d
m.o = f
a.o = h
assert h.u.v.w.t.o.q.o.v.w.txt == "b"