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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.o: A = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.z: C = None
        self.p: A = None
        self.txt = txt

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

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

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

g = A("g")
h = B("h")
l = C("l")
n = D("n")
j = E("j")
k = F("k")
m = G("m")
b = G("b")

g.y = l
h.u = j
h.o = j
h.y = k
h.x = n
h.s = g
h.r = g
l.y = h
l.s = g
l.o = g
l.r = g
n.r = j
n.u = l
n.z = l
n.p = g
j.q = l
j.x = n
k.u = n
m.x = b
b.x = m
assert l.y.u.q.y.y.u.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.o: A = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.z: C = None
        self.p: A = None
        self.txt = txt

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

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

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

g = A("g")
h = B("h")
l = C("l")
n = D("n")
j = E("j")
k = F("k")
m = G("m")
b = G("b")

g.y = l
h.u = j
h.o = j
h.y = k
h.x = n
h.s = g
h.r = g
l.y = h
l.s = g
l.o = g
l.r = g
n.r = j
n.u = l
n.z = l
n.p = g
j.q = l
j.x = n
k.u = n
m.x = b
b.x = m
assert l.y.u.q.y.y.u.z.y.txt == "h"