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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: G = None
        self.x: F = None
        self.v: C = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: F = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: D = None
        self.s: E = None
        self.y: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: G = None
        self.x: F = None
        self.v: C = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: F = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: D = None
        self.s: E = None
        self.y: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.txt = txt

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

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