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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.txt = txt

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

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