class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: I = None
        self.w: B = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: D = None
        self.z: E = None
        self.r: E = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: B = None
        self.txt = txt

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

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

j.o = k
j.s = f
j.w = l
j.q = e
l.u = c
l.p = j
e.x = c
e.o = m
e.z = k
e.r = k
e.v = f
m.y = l
m.x = e
k.u = e
b.r = c
i.w = l
i.o = n
c.x = f
c.u = l
f.r = i
n.r = c
assert b.r.x.r.o.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: I = None
        self.w: B = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: D = None
        self.z: E = None
        self.r: E = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: B = None
        self.txt = txt

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

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

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