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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.t: E = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: D = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: C = None
        self.txt = txt

l = A("l")
h = B("h")
d = C("d")
g = D("g")
i = E("i")
f = F("f")
b = A("b")

l.r = i
l.y = i
l.o = h
l.t = b
l.p = b
h.w = d
h.r = d
h.v = i
d.q = g
d.s = f
d.t = i
d.u = l
d.y = b
g.w = f
g.y = f
g.r = f
g.u = b
g.v = h
g.o = d
i.u = h
i.w = h
i.v = g
i.z = d
f.o = g
f.v = d
b.r = i
b.y = i
b.o = h
b.t = l
b.p = l
assert i.v.v.r.t.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: B = None
        self.t: A = None
        self.p: A = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.t: E = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: D = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: C = None
        self.txt = txt

l = A("l")
h = B("h")
d = C("d")
g = D("g")
i = E("i")
f = F("f")
b = A("b")

l.r = i
l.y = i
l.o = h
l.t = b
l.p = b
h.w = d
h.r = d
h.v = i
d.q = g
d.s = f
d.t = i
d.u = l
d.y = b
g.w = f
g.y = f
g.r = f
g.u = b
g.v = h
g.o = d
i.u = h
i.w = h
i.v = g
i.z = d
f.o = g
f.v = d
b.r = i
b.y = i
b.o = h
b.t = l
b.p = l
assert i.v.v.r.t.v.u.txt == "b"