class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: F = None
        self.u: E = None
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: G = None
        self.v: A = None
        self.s: D = None
        self.u: C = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: A = None
        self.txt = txt

g = A("g")
j = B("j")
a = C("a")
i = D("i")
l = E("l")
m = F("m")
h = G("h")

g.t = i
g.u = j
j.z = i
j.x = l
a.w = h
a.t = m
a.u = l
a.z = j
i.q = l
l.s = m
l.z = h
l.o = h
l.x = j
l.v = a
m.p = a
m.u = a
m.w = h
m.v = g
m.s = i
m.q = j
h.p = l
h.q = g
assert h.p.z.p.s.w.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: F = None
        self.u: E = None
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: G = None
        self.v: A = None
        self.s: D = None
        self.u: C = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: A = None
        self.txt = txt

g = A("g")
j = B("j")
a = C("a")
i = D("i")
l = E("l")
m = F("m")
h = G("h")

g.t = i
g.u = j
j.z = i
j.x = l
a.w = h
a.t = m
a.u = l
a.z = j
i.q = l
l.s = m
l.z = h
l.o = h
l.x = j
l.v = a
m.p = a
m.u = a
m.w = h
m.v = g
m.s = i
m.q = j
h.p = l
h.q = g
assert h.p.z.p.s.w.p.x.txt == "j"