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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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