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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: A = None
        self.v: B = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: A = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: D = None
        self.q: C = None
        self.p: A = None
        self.txt = txt

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

d = A("d")
c = B("c")
f = C("f")
h = D("h")
b = E("b")
e = F("e")
n = B("n")
g = B("g")
k = E("k")
m = E("m")

d.t = g
d.u = f
d.x = e
c.w = e
c.x = d
c.o = d
c.v = n
f.x = e
f.t = d
f.y = d
f.r = d
h.r = g
h.s = g
h.p = f
b.w = g
b.x = h
b.q = f
b.p = d
e.r = h
n.w = e
n.x = d
n.o = d
n.v = c
g.w = e
g.x = d
g.o = d
g.v = n
k.w = g
k.x = h
k.q = f
k.p = d
m.w = c
m.x = h
m.q = f
m.p = d
assert g.w.r.p.r.x.r.s.o.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: C = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: A = None
        self.v: B = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: A = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: D = None
        self.q: C = None
        self.p: A = None
        self.txt = txt

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

d = A("d")
c = B("c")
f = C("f")
h = D("h")
b = E("b")
e = F("e")
n = B("n")
g = B("g")
k = E("k")
m = E("m")

d.t = g
d.u = f
d.x = e
c.w = e
c.x = d
c.o = d
c.v = n
f.x = e
f.t = d
f.y = d
f.r = d
h.r = g
h.s = g
h.p = f
b.w = g
b.x = h
b.q = f
b.p = d
e.r = h
n.w = e
n.x = d
n.o = d
n.v = c
g.w = e
g.x = d
g.o = d
g.v = n
k.w = g
k.x = h
k.q = f
k.p = d
m.w = c
m.x = h
m.q = f
m.p = d
assert g.w.r.p.r.x.r.s.o.u.x.txt == "e"