class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: F = None
        self.u: F = None
        self.s: E = None
        self.t: C = None
        self.z: D = None
        self.txt = txt

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

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

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

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

h.s = g
b.o = h
b.r = h
b.q = h
b.y = g
b.x = l
j.w = h
j.q = e
j.u = c
j.s = l
j.t = d
j.z = g
g.u = e
l.r = k
c.v = e
c.u = e
c.o = g
d.w = h
d.q = c
d.u = c
d.s = l
d.t = j
d.z = g
e.v = c
e.u = c
e.o = g
n.w = h
n.q = e
n.u = e
n.s = l
n.t = d
n.z = g
k.r = l
assert n.w.s.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: F = None
        self.u: F = None
        self.s: E = None
        self.t: C = None
        self.z: D = None
        self.txt = txt

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

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

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

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

h.s = g
b.o = h
b.r = h
b.q = h
b.y = g
b.x = l
j.w = h
j.q = e
j.u = c
j.s = l
j.t = d
j.z = g
g.u = e
l.r = k
c.v = e
c.u = e
c.o = g
d.w = h
d.q = c
d.u = c
d.s = l
d.t = j
d.z = g
e.v = c
e.u = c
e.o = g
n.w = h
n.q = e
n.u = e
n.s = l
n.t = d
n.z = g
k.r = l
assert n.w.s.u.o.txt == "g"