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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: C = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

j = A("j")
b = B("b")
e = C("e")
f = D("f")
i = E("i")
h = F("h")

j.v = i
j.r = h
b.z = i
b.o = i
b.r = i
b.s = e
e.u = h
f.u = j
f.s = j
f.r = i
i.y = f
i.r = j
h.t = b
h.w = f
assert e.u.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: C = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

j = A("j")
b = B("b")
e = C("e")
f = D("f")
i = E("i")
h = F("h")

j.v = i
j.r = h
b.z = i
b.o = i
b.r = i
b.s = e
e.u = h
f.u = j
f.s = j
f.r = i
i.y = f
i.r = j
h.t = b
h.w = f
assert e.u.t.o.txt == "i"