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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: H = None
        self.p: B = None
        self.r: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.u: B = None
        self.y: F = None
        self.x: E = None
        self.w: I = None
        self.q: D = None
        self.p: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: H = None
        self.p: B = None
        self.r: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.u: B = None
        self.y: F = None
        self.x: E = None
        self.w: I = None
        self.q: D = None
        self.p: I = None
        self.txt = txt

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

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

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