class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: C = None
        self.p: E = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: A = None
        self.w: B = None
        self.u: D = None
        self.q: D = None
        self.r: D = None
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: C = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

h = A("h")
k = B("k")
j = C("j")
a = D("a")
b = E("b")
m = F("m")
c = G("c")

h.x = k
h.s = j
h.w = j
h.p = b
k.s = b
j.p = b
j.t = h
j.w = k
j.v = k
j.u = a
j.q = a
j.r = a
a.t = k
a.o = c
b.t = m
b.v = c
m.p = h
c.p = b
c.y = j
c.u = j
c.x = a
assert h.x.s.v.x.t.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: C = None
        self.p: E = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: A = None
        self.w: B = None
        self.u: D = None
        self.q: D = None
        self.r: D = None
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: C = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

h = A("h")
k = B("k")
j = C("j")
a = D("a")
b = E("b")
m = F("m")
c = G("c")

h.x = k
h.s = j
h.w = j
h.p = b
k.s = b
j.p = b
j.t = h
j.w = k
j.v = k
j.u = a
j.q = a
j.r = a
a.t = k
a.o = c
b.t = m
b.v = c
m.p = h
c.p = b
c.y = j
c.u = j
c.x = a
assert h.x.s.v.x.t.s.v.txt == "c"