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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.s: B = None
        self.v: F = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.s: B = None
        self.v: F = None
        self.q: E = None
        self.txt = txt

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

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