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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: A = None
        self.u: A = None
        self.w: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: E = None
        self.u: A = None
        self.txt = txt

k = A("k")
h = B("h")
n = C("n")
b = D("b")
d = E("d")
m = F("m")
c = G("c")

k.o = d
k.r = d
k.x = n
k.z = n
k.q = n
k.t = b
k.y = h
h.w = k
h.y = k
h.v = b
h.x = b
h.u = d
h.p = d
n.v = k
n.q = k
n.u = k
n.w = h
b.p = m
b.q = k
b.w = h
b.r = n
b.z = d
b.o = c
d.r = b
d.z = b
d.y = n
m.t = k
m.u = n
m.v = d
c.x = k
c.u = k
c.s = d
assert d.r.q.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.r: E = None
        self.t: D = None
        self.z: C = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: A = None
        self.u: A = None
        self.w: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: E = None
        self.u: A = None
        self.txt = txt

k = A("k")
h = B("h")
n = C("n")
b = D("b")
d = E("d")
m = F("m")
c = G("c")

k.o = d
k.r = d
k.x = n
k.z = n
k.q = n
k.t = b
k.y = h
h.w = k
h.y = k
h.v = b
h.x = b
h.u = d
h.p = d
n.v = k
n.q = k
n.u = k
n.w = h
b.p = m
b.q = k
b.w = h
b.r = n
b.z = d
b.o = c
d.r = b
d.z = b
d.y = n
m.t = k
m.u = n
m.v = d
c.x = k
c.u = k
c.s = d
assert d.r.q.o.r.txt == "b"