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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: D = None
        self.w: F = None
        self.t: F = None
        self.r: D = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: C = None
        self.p: A = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: D = None
        self.w: F = None
        self.t: F = None
        self.r: D = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: C = None
        self.p: A = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

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

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

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