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

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

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

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

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

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

h = A("h")
e = B("e")
f = C("f")
g = D("g")
i = E("i")
l = F("l")
c = A("c")

h.x = f
h.p = l
h.q = i
h.y = i
h.u = i
e.t = h
e.q = h
e.p = i
e.y = i
e.z = c
e.x = g
f.s = l
g.q = f
i.u = e
l.y = g
c.x = f
c.p = l
c.q = i
c.y = i
c.u = i
assert l.y.q.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.q: E = None
        self.y: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
e = B("e")
f = C("f")
g = D("g")
i = E("i")
l = F("l")
c = A("c")

h.x = f
h.p = l
h.q = i
h.y = i
h.u = i
e.t = h
e.q = h
e.p = i
e.y = i
e.z = c
e.x = g
f.s = l
g.q = f
i.u = e
l.y = g
c.x = f
c.p = l
c.q = i
c.y = i
c.u = i
assert l.y.q.s.y.txt == "g"