class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.t: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: B = None
        self.s: B = None
        self.txt = txt

c = A("c")
b = B("b")
k = C("k")
e = D("e")
d = E("d")
l = F("l")
j = G("j")
m = H("m")
g = B("g")

c.z = l
c.x = m
b.q = c
b.v = k
b.t = m
k.y = g
k.s = c
k.u = d
e.v = c
d.t = k
l.r = d
l.t = c
l.u = c
l.y = c
l.s = e
l.q = m
j.y = k
m.t = l
m.y = g
m.s = b
g.q = c
g.v = k
g.t = m
assert k.s.x.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.t: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: B = None
        self.s: B = None
        self.txt = txt

c = A("c")
b = B("b")
k = C("k")
e = D("e")
d = E("d")
l = F("l")
j = G("j")
m = H("m")
g = B("g")

c.z = l
c.x = m
b.q = c
b.v = k
b.t = m
k.y = g
k.s = c
k.u = d
e.v = c
d.t = k
l.r = d
l.t = c
l.u = c
l.y = c
l.s = e
l.q = m
j.y = k
m.t = l
m.y = g
m.s = b
g.q = c
g.v = k
g.t = m
assert k.s.x.t.q.txt == "m"