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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: A = None
        self.s: C = None
        self.w: E = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: E = None
        self.y: A = None
        self.u: B = None
        self.w: D = 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.u: C = None
        self.r: G = None
        self.o: A = None
        self.txt = txt

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

h = A("h")
a = B("a")
e = C("e")
d = D("d")
k = E("k")
l = F("l")
c = G("c")
g = D("g")
n = F("n")
f = G("f")

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: A = None
        self.s: C = None
        self.w: E = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: E = None
        self.y: A = None
        self.u: B = None
        self.w: D = 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.u: C = None
        self.r: G = None
        self.o: A = None
        self.txt = txt

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

h = A("h")
a = B("a")
e = C("e")
d = D("d")
k = E("k")
l = F("l")
c = G("c")
g = D("g")
n = F("n")
f = G("f")

h.s = k
h.y = k
a.q = c
a.o = h
a.s = e
a.w = k
a.z = n
e.o = a
e.p = k
d.x = h
d.y = h
d.o = k
d.u = a
d.w = g
k.q = g
l.u = e
l.r = f
l.o = h
c.o = f
g.x = h
g.y = h
g.o = k
g.u = a
g.w = d
n.u = e
n.r = c
n.o = h
f.o = c
assert d.o.q.x.y.q.u.txt == "a"