class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: B = None
        self.r: F = None
        self.x: E = None
        self.y: E = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.t: C = None
        self.u: E = None
        self.q: A = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

l = A("l")
f = B("f")
h = C("h")
j = D("j")
m = E("m")
e = F("e")
c = G("c")
i = B("i")
n = B("n")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: B = None
        self.r: F = None
        self.x: E = None
        self.y: E = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.t: C = None
        self.u: E = None
        self.q: A = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

l = A("l")
f = B("f")
h = C("h")
j = D("j")
m = E("m")
e = F("e")
c = G("c")
i = B("i")
n = B("n")

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