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

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

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

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

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

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

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

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

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

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

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

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

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

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

j.u = a
j.w = a
j.y = g
j.t = k
l.u = a
l.p = h
e.u = j
e.o = a
e.r = a
e.v = h
d.t = k
d.o = b
k.q = h
m.y = l
m.w = l
g.q = d
b.u = a
b.y = g
b.t = g
b.w = e
h.t = k
h.o = b
a.u = j
a.o = e
a.r = e
a.v = h
assert m.w.p.t.q.t.q.o.w.u.y.txt == "g"