class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: F = None
        self.o: C = None
        self.x: C = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: B = None
        self.x: D = None
        self.q: F = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: F = None
        self.o: C = None
        self.x: C = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: B = None
        self.x: D = None
        self.q: F = None
        self.z: G = None
        self.txt = txt

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

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

c.y = m
c.t = g
g.r = m
g.o = h
m.r = h
m.t = k
m.v = c
b.q = k
b.s = k
b.v = f
b.o = m
b.x = m
k.w = g
k.t = g
k.x = g
k.z = f
f.v = m
f.w = g
f.x = b
f.q = l
f.z = h
h.o = b
h.w = b
h.r = c
l.v = m
l.w = g
l.x = b
l.q = f
l.z = h
assert h.r.t.r.r.o.txt == "b"