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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: B = None
        self.p: C = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.u: G = None
        self.p: C = None
        self.x: F = None
        self.v: B = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: B = None
        self.q: I = None
        self.t: B = None
        self.x: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: A = None
        self.txt = txt

m = A("m")
f = B("f")
h = C("h")
c = D("c")
j = E("j")
g = F("g")
e = G("e")
l = H("l")
n = I("n")
a = G("a")

m.q = l
m.x = c
f.q = n
h.u = m
h.o = j
c.v = n
c.y = f
c.p = h
c.z = j
j.r = h
j.z = h
j.p = h
j.u = a
j.x = g
j.v = f
j.y = l
g.v = j
g.u = f
g.t = f
g.q = n
g.x = h
e.s = f
e.o = c
e.r = j
l.p = c
n.u = h
n.z = m
a.s = f
a.o = c
a.r = j
assert e.r.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: B = None
        self.p: C = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.u: G = None
        self.p: C = None
        self.x: F = None
        self.v: B = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: B = None
        self.q: I = None
        self.t: B = None
        self.x: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: A = None
        self.txt = txt

m = A("m")
f = B("f")
h = C("h")
c = D("c")
j = E("j")
g = F("g")
e = G("e")
l = H("l")
n = I("n")
a = G("a")

m.q = l
m.x = c
f.q = n
h.u = m
h.o = j
c.v = n
c.y = f
c.p = h
c.z = j
j.r = h
j.z = h
j.p = h
j.u = a
j.x = g
j.v = f
j.y = l
g.v = j
g.u = f
g.t = f
g.q = n
g.x = h
e.s = f
e.o = c
e.r = j
l.p = c
n.u = h
n.z = m
a.s = f
a.o = c
a.r = j
assert e.r.y.p.txt == "c"