class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.w: C = None
        self.txt = txt

i = A("i")
b = B("b")
e = C("e")
f = D("f")
h = E("h")
k = E("k")
g = B("g")

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.w: C = None
        self.txt = txt

i = A("i")
b = B("b")
e = C("e")
f = D("f")
h = E("h")
k = E("k")
g = B("g")

i.r = g
i.q = f
b.o = f
b.x = g
b.s = i
b.v = h
e.u = f
e.r = k
e.y = k
f.y = i
h.t = k
h.r = k
h.w = e
k.t = h
k.r = h
k.w = e
g.o = f
g.x = b
g.s = i
g.v = k
assert i.r.x.v.txt == "h"