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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.q: H = None
        self.r: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: A = None
        self.r: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: E = None
        self.u: D = None
        self.o: I = None
        self.r: I = None
        self.y: D = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

i = A("i")
a = B("a")
c = C("c")
f = D("f")
k = E("k")
e = F("e")
g = G("g")
d = H("d")
j = I("j")

i.r = c
i.p = c
i.t = a
a.v = c
a.o = f
a.q = d
a.r = d
c.w = a
f.q = g
k.q = c
e.u = k
e.z = i
e.r = j
g.x = k
g.v = i
d.s = i
d.t = k
d.u = f
d.y = f
d.o = j
d.r = j
d.z = e
j.q = k
assert g.v.t.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.q: H = None
        self.r: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: A = None
        self.r: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: E = None
        self.u: D = None
        self.o: I = None
        self.r: I = None
        self.y: D = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

i = A("i")
a = B("a")
c = C("c")
f = D("f")
k = E("k")
e = F("e")
g = G("g")
d = H("d")
j = I("j")

i.r = c
i.p = c
i.t = a
a.v = c
a.o = f
a.q = d
a.r = d
c.w = a
f.q = g
k.q = c
e.u = k
e.z = i
e.r = j
g.x = k
g.v = i
d.s = i
d.t = k
d.u = f
d.y = f
d.o = j
d.r = j
d.z = e
j.q = k
assert g.v.t.q.y.txt == "f"