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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: F = None
        self.w: C = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: F = None
        self.w: C = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

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