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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: E = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: B = None
        self.p: B = None
        self.r: F = None
        self.v: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: B = None
        self.z: A = None
        self.v: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: D = None
        self.q: C = None
        self.x: D = None
        self.t: A = None
        self.txt = txt

l = A("l")
n = B("n")
g = C("g")
m = D("m")
j = E("j")
h = F("h")
c = E("c")
k = F("k")
i = A("i")

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: E = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: B = None
        self.p: B = None
        self.r: F = None
        self.v: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: B = None
        self.z: A = None
        self.v: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: D = None
        self.q: C = None
        self.x: D = None
        self.t: A = None
        self.txt = txt

l = A("l")
n = B("n")
g = C("g")
m = D("m")
j = E("j")
h = F("h")
c = E("c")
k = F("k")
i = A("i")

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