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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.p: A = None
        self.x: G = None
        self.y: G = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.p: E = None
        self.q: B = None
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.p: A = None
        self.x: G = None
        self.y: G = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.p: E = None
        self.q: B = None
        self.t: B = None
        self.txt = txt

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

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