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

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

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

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

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

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

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

m.w = g
m.v = g
m.u = j
f.u = d
l.s = d
l.p = g
l.r = g
d.x = n
d.q = f
d.t = j
j.q = n
j.u = n
j.o = f
g.q = j
g.v = l
g.x = f
n.x = d
n.q = f
n.t = j
c.w = g
c.v = g
c.u = j
a.x = n
a.q = f
a.t = j
h.s = d
h.p = g
h.r = g
assert a.x.t.u.t.o.u.q.u.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

m.w = g
m.v = g
m.u = j
f.u = d
l.s = d
l.p = g
l.r = g
d.x = n
d.q = f
d.t = j
j.q = n
j.u = n
j.o = f
g.q = j
g.v = l
g.x = f
n.x = d
n.q = f
n.t = j
c.w = g
c.v = g
c.u = j
a.x = n
a.q = f
a.t = j
h.s = d
h.p = g
h.r = g
assert a.x.t.u.t.o.u.q.u.x.q.txt == "f"