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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: A = None
        self.q: C = None
        self.o: E = None
        self.s: E = None
        self.p: B = None
        self.t: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: A = None
        self.q: C = None
        self.o: E = None
        self.s: E = None
        self.p: B = None
        self.t: C = None
        self.txt = txt

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

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

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